package de.teamgamma.cansat.groundstation.export;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import org.jfree.chart.JFreeChart;

import de.szut.gui.language.Languages;
import de.szut.gui.language.TranslatableComponent;

import de.teamgamma.cansat.groundstation.control.Controller;

/**
 * Panel for the display of a graph with the logged data
 * @author Marc Huisinga
 *
 */
public class ShowPanel extends DefaultChartPanel {

	private static final long serialVersionUID = 2207290365474367715L;
	
	private ArrayList<TranslatableComponent> translatableComponents;
	
	public ShowPanel(JFreeChart chart) {
		super(chart);
		
		translatableComponents = new ArrayList<TranslatableComponent>();
		
		Languages.prepareComponent("export.ShowPanel.return", getReturnButton(), translatableComponents);
		getReturnButton().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				Controller.getInstance().getGuiController().toggleCurrentPanel(new ExportPanel());
			}
		});
		
		Controller.getInstance().getGuiController().getLanguages().translateListOfComponents(translatableComponents);
	}
}
